import request from '@/utils/request'

// 获取权限列表
export const getPermissionList = () => request({
  url: '/sys/permission'
})

// 权限新增
export const addPermission = data => request({
  method: 'POST',
  url: '/sys/permission',
  data
})

// 权限删除
export const delPermission = id => request({
  method: 'DELETE',
  url: `/sys/permission/${id}`
})

// 请求权限详细信息
export const detailDataPermission = id => request({
  url: `/sys/permission/${id}`
})

// 编辑详细信息
export const redactDataPermission = data => request({
  method: 'PUT',
  url: `/sys/permission/${data.id}`,
  data
})

// 给角色分配权限
export const assignPerm = data => request({
  url: '/sys/role/assignPrem',
  method: 'PUT',
  data
})
